function validate(){
	var bookid=document.form.bookid.value;
	var studentname=document.form.studentname.value;
	var rollno=document.form.rollno.value;
	var bookname=document.form.bookname.value;
	var authorname=document.form.authorname.value;
	var course=document.form.course.value;
	var year=document.form.year.value;
	var contactno=document.form.contactno.value;
	if(bookid == ""){
		alert("enter book id");
		return false;
	}
	if(isNaN(parseInt(bookid))){
		alert("Enter Book Id as numerics");
	}
	if(studentname == ""){
		alert("enter student name");
		return false;
	}
	if(rollno ==""){
		alert("enter rollnumber");
		return false;
	}
	if(bookname ==""){
		alert("enter book name");
		return false;
	}
	if(authorname ==""){
		alert("enter authorname");
		return false;
	}
	if(course ==""){
		alert("enter course");
		return false;
	}
	if(year ==""){
		alert("enter year");
		return false;
	}
	if(contactno ==""){
		alert("enter contact number");
		return false;
	}
	return true;
}
function showData(id) {
	xmlHttp = GetXmlHttpObject()
	var url = "issuestore.jsp";
	url = url + "?id=" + id;
	xmlHttp.open("GET", url, true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange = stateChanged
}
function stateChanged() {
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
		var showdata = xmlHttp.responseText;
		var strar = showdata.split(":");
		if (strar.length > 1) {
			//var strname = strar[1];
			document.getElementById("bookname").value = strar[2];
			document.getElementById("authorname").value = strar[3];

		}
	}
}
function GetXmlHttpObject() {
	var xmlHttp = null;
	try {
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}